<template>
  <div class="header_t">
    <div class="left">
      <img @click="goBack" v-if="showClose" class="close" src="../assets/叉.png" alt="" />
      <span>{{ title }}</span>
    </div>
    <img
      v-if="showSetting"
      class="setting"
      src="../assets/设 置.png"
      alt=""
      @click="setting()"
    />
  </div>
</template>

<script>
export default {
  props: {
    title: {
      type: String,
      default: "111",
    },
    showClose: {
      type: Boolean,
      default: true,
    },
    showSetting: {
      type: Boolean,
      default: false,
    },
  },
  methods: {
    setting() {
      this.$router.push("/logOut");
    },
    goBack() {
      this.$router.back(-1)
    }
  },
};
</script>

<style lang='less' scoped>
.header_t {
  //   position: fixed;
  //   top: 0;
  //   left: 0;
  width: 375px;
  height: 40px;
  display: flex;
  align-items: center;
  // justify-content: center;
  .left {
    flex: 1;
  }
  .close {
    width: 30px;
    // height: 20px;
  }
  .setting {
    width: 25px;
  }
}
</style>